package com.lemner.motion.base;

import com.lemner.motion.bean.BaseBean;
import com.lemner.motion.bean.GetrecordBean;
import com.lemner.motion.bean.GetschoolBean;
import com.lemner.motion.bean.LocationBean;
import com.lemner.motion.bean.LoginBean;
import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;


/**
 * Created by 小博 on 2018/3/23.
 */

public interface BaseService {

    //登陆
    @GET("Student/Login")
    Call<LoginBean> getLogin(@Query("studentNum") String username,
                             @Query("studentPasswd") String userpass
    );

    //获取学校列表
    @GET("Student/getSchoolList")
    Call<GetschoolBean>getSchool(
            @Query("schoolName") String schoolName
    );

    //获取验证码
    @POST("Student/sendCode")
    Call<BaseBean> getCode(
            @Query("phoneNum") String phoneNum
    );

    //注册
    @POST("Student/Register")
    Call<BaseBean> getReg(
            @Query("studentNum") String studentNum,
            @Query("schoolName") String schname,
            @Query("phoneNum") String phoneNum,
            @Query("studentPasswd") String studentPasswd,
            @Query("code") String code

    );

    //获取个人信息
    @POST("Student/getPersonalInformation")
    Call<LoginBean> getUser(
            @Query("studentId") String studentid,
             @Query("sessionId") String session
    );
    //修改个人信息
    @Multipart
    @POST("Student/updatePersonalInformation")
    Call<BaseBean> updateUser(
            @Query("studentId") String studentid,
            @Query("studentName") String studentName,
            @Part MultipartBody.Part file,
            @Query("sessionId")String session
    );
    //修改学生姓名
    @POST("Student/updatePersonalInformation")
    Call<BaseBean> updatename(
            @Query("studentId") String studentid,
            @Query("studentName") String studentName,
            @Query("sessionId")String session
    );
    //修改学生性别
    @POST("Student/updatePersonalInformation")
    Call<BaseBean> updatesex(
            @Query("studentId") String studentid,
            @Query("studentSex") String studentSex,
            @Query("sessionId")String session
    );

   //修改密码
   @POST("Student/updatePasswd")
   Call<BaseBean> updatepwd(
           @Query("studentId") String studentid,
           @Query("newPasswd") String newPasswd,
           @Query("studentPasswd") String studentPasswd,
           @Query("sessionId") String sessionId
   );
   //修改手机号码
   @POST("Student/updatePhoneNum")
   Call<BaseBean> updatephone(
           @Query("studentId") String studentid,
           @Query("newPhoneNum") String newPhoneNum,
           @Query("code") String code,
           @Query("sessionId") String sessionId
   );
   //上传跑步记录
//    @Headers({"Content-Type: application/json","Accept: application/json"})//需要添加头
//    @POST("Record/uploadRunningRecord")
//    Call<BaseBean> uploadRunningRecord(@Body RequestBody route);//传入的参数为RequestBody
   //@FormUrlEncoded
    //上传跑步数据
   @FormUrlEncoded
   @POST("Record/uploadRunningRecord")
   Call<BaseBean> uploadRunningRecord(@Field("Json") String route);
   //上传跑步地图截屏
   @Multipart
   @POST("Record/uploadRunningImage")
   Call<BaseBean> uploadRunningImage(@Part MultipartBody.Part file,
                                      @Query("sessionId") String sessionId,
                                     @Query("studentId") String studentId);
   //  上传坐标给服务器
   @POST("route/getMessage")
   Call<LocationBean> uploadLocation(
           @Query("studentId") String studentid,
           @Query("schoolName") String newPhoneNum,
           @Query("studentLocal") String studentLocal,
           @Query("sessionId") String sessionId
   );
   //获取跑步记录
    @POST("Record/getRunningRecord")
    Call<GetrecordBean>getRecord(
            @Query("studentId") String studentid,
            @Query("sessionId") String sessionId,
            @Query("mouth") String mouth
    );

}
